#include "mystdio.h"
#include <string.h>
#include <unistd.h>

int main()
{
	MYFILE *fp = myfopen("haha.txt", "w");
	if(!fp)
	{
		perror("myopen fail\n");
		return 1;
	}
	char buffer[100] = "hello man!!!";

	int cnt = 10;
	while(cnt--)
	{
		mywrite(fp, buffer, strlen(buffer));
		printf("buffer: %s\n", fp->buffer);
		sleep(1);
	}
	myclose(fp);
	return 0;
}
